cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / Synth control / Demand Rate / Dreset.html
blobfc1b310ecf5f3e6e1af06241b8abe8bf78b4e55f
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="1038.32">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #cd1713}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #102ac3}
16 span.s1 {font: 18.0px Helvetica}
17 span.s2 {color: #1738f5}
18 span.s3 {font: 12.0px Helvetica; color: #000000}
19 span.s4 {color: #102ac3}
20 span.s5 {color: #102ac2}
21 span.s6 {color: #000000}
22 span.Apple-tab-span {white-space:pre}
23 </style>
24 </head>
25 <body>
26 <p class="p1"><span class="s1"><b>Dreset<span class="Apple-tab-span"> </span></b></span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>demand rate reset<span class="Apple-converted-space"> </span></b></p>
27 <p class="p2"><br></p>
28 <p class="p1">The reset of a demand ugen can be controlled "from the outside" by the reset input of the <a href="Demand.html"><span class="s2">Demand</span></a> or <a href="Duty.html"><span class="s2">Duty</span></a> UGen, which consumes the chain of demands. <b>Dreset</b> allows to reset a subset of the chain internally.</p>
29 <p class="p2"><br></p>
30 <p class="p1">superclass: <a href="../../../Core/Object.html"><span class="s2"><b>Object</b></span></a><b> : </b><a href="../../UGen.html"><span class="s2"><b>UGen</b></span></a><b> : </b>DUGen<b><span class="Apple-converted-space"> </span></b></p>
31 <p class="p2"><br></p>
32 <p class="p1"><b>*new(in, reset)</b></p>
33 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
34 <p class="p1"><b>in</b> - a demand UGen, producing values which are passed through</p>
35 <p class="p1"><b>reset</b> - a demand or any other UGen. When crossing from nonpositive to positive, it resets the first argument.</p>
36 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
37 <p class="p2"><span class="Apple-tab-span"> </span></p>
38 <p class="p3"><span class="s3"><span class="Apple-tab-span"> </span></span>// example</p>
39 <p class="p4"><span class="Apple-tab-span"> </span></p>
40 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
41 <p class="p5"><span class="Apple-tab-span"> </span>{<span class="Apple-converted-space"> </span></p>
42 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">var</span> a, freq;</p>
43 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = <span class="s4">Dreset</span>(<span class="s4">Dseries</span>(0, 2, <span class="s4">inf</span>), <span class="s4">Drand</span>([0, 0, 0, 1], <span class="s4">inf</span>));</p>
44 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>freq = <span class="s4">Duty</span>.kr(1/<span class="s5">MouseX</span>.kr(1, 40, 1), 0, a) * 30 + 340;<span class="Apple-converted-space"> </span></p>
45 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">SinOsc</span>.ar(freq) * 0.1</p>
46 <p class="p5"><span class="Apple-tab-span"> </span>}.play;</p>
47 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
48 <p class="p4"><span class="Apple-tab-span"> </span></p>
49 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// reset when mouse button is pressed</p>
50 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
51 <p class="p5"><span class="Apple-tab-span"> </span>{</p>
52 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">var</span> a, freq;</p>
53 <p class="p6"><span class="s6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = </span>Dreset<span class="s6">(</span>Dseries<span class="s6">(0, 2, </span>inf<span class="s6">), </span>MouseButton<span class="s6">.kr);</span></p>
54 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>freq = <span class="s5">Duty</span>.kr(1/<span class="s5">MouseX</span>.kr(1, 40, 1), 0, a) * 30 + 340;<span class="Apple-converted-space"> </span></p>
55 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">SinOsc</span>.ar(freq) * 0.1</p>
56 <p class="p5"><span class="Apple-tab-span"> </span>}.play;</p>
57 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
58 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
59 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// audio rate</p>
60 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
61 <p class="p5"><span class="Apple-tab-span"> </span>{<span class="Apple-converted-space"> </span></p>
62 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">var</span> a, nmax = 90;</p>
63 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = { <span class="s4">Dreset</span>(<span class="s4">Dseries</span>(0, 1, <span class="s4">inf</span>), <span class="s4">Drand</span>(0 ! nmax ++ 1, <span class="s4">inf</span>)) } ! 2;</p>
64 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">Duty</span>.ar(<span class="s4">SampleDur</span>.ir, 0, a) * (0.1 / nmax)</p>
65 <p class="p5"><span class="Apple-tab-span"> </span>}.play;</p>
66 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
67 <p class="p4"><br></p>
68 <p class="p4"><span class="Apple-tab-span"> </span></p>
69 <p class="p4"><span class="Apple-tab-span"> </span></p>
70 </body>
71 </html>